<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/


//后台交互路由
Route::group(['prefix' => 'back','namespace' => 'Admin','middleware' => 'login'], function() {
    Route::get('index','IndexController@getIndex');
    Route::controller('admin','AdminController');
    Route::controller('user','UserController');
    Route::controller('recycle','RecycleController');
    Route::controller('category','CategoryController');
});
    //注册,认证路由
    Route::controller('back','Admin\LoginController');




//IndexController
//    Route::get('index','Admin\IndexController@is_logged_in');                                        //get方法登录后台要通过session检查
//
//    //AdminContorller
//    Route::post('index','Admin\AdminController@index');                                              //post方法登录后台
//
//    Route::get('signup','Admin\AdminController@signup');                                             //管理员注册视图
//    Route::post('login','Admin\AdminController@do_signup');                                          //管理员注册操作
//
//    Route::get('login','Admin\AdminController@logout');                                              //管理员注销
//
//    Route::get('table','Admin\AdminController@admin_table');                                   //管理员列表
//    Route::get('form','Admin\AdminController@admin_form');                                     //添加管理员表单
//
//    Route::get('update?id={id?}','Admin\AdminController@user_update_form');                        //管理员信息修改表单
//    Route::post('update/{id}','Admin\AdminController@user_update');                            //管理员信息修改操作
//    Route::get('delete/{id}','Admin\AdminController@user_delete');                             //管理员回收操作

    //UserController
//    Route::get('user_table','Admin\UserController@user_table');                                      //用户列表
//    Route::get('user_form','Admin\UserController@user_form');                                        //添加用户表单

//    Route::get('user_update/{id}','Admin\UserController@user_update_form');    //用户信息修改表单
//    Route::post('user_update/{id}','Admin\UserController@user_update');        //用户信息修改操作
//    Route::get('user_delete/{id}','Admin\UserController@user_delete');         //用户回收操作
//
//
//    //RecycleController
//    Route::get('admin-recycle','Admin\RecycleController@admin_recycle');
//    Route::get('user_recycle','Admin\RecycleController@user_recycle');



//前台交互路由`
Route::group(['prefix' => 'home'], function(){
    Route::get('index','Home\IndexController@index');                                                        //访问前台主页视图无限制
    Route::post('index','Home\UserController@index');                                                        //用户post请求前台主页视图

    Route::get('signup','Home\UserController@signup');                         //会员注册视图
    Route::get('logout','Home\UserController@logout');                          //
    Route::post('login','Home\UserController@do_signup');                      //
});




// 认证路由...
//Route::get('auth/login', 'Auth\AuthController@getLogin');
//Route::post('auth/login', 'Auth\AuthController@postLogin');
//Route::post('admin/login', 'Models\PublicController@postLogin');
//Route::get('auth/logout', 'Auth\AuthController@getLogout');

// 注册路由...
//Route::get('auth/register', 'Auth\AuthController@getRegister');
//Route::post('auth/register', 'Auth\AuthController@postRegister');
